package org.liushao.dao.impl;

import org.liushao.dao.AccountDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

/**
 * @program: untitled
 * @ClassName AccountDaoImpl
 * @description:
 * @author: 刘庆东
 * @create: 2024−11-28 14:05
 * @Version 1.0
 **/
@Repository
public class AccountDaoImpl implements AccountDao {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Override
    public void reduceMoney() {
        String sql="update account set amoney=amoney-? where aname=?";
        jdbcTemplate.update(sql,100,"tiger");
    }

    @Override
    public void addMoney() {
        String sql="update account set amoney=amoney+? where aname=?";
        jdbcTemplate.update(sql,100,"liushao");

    }
}
